const express = require('express')
const app = express()
const PORT = 9001
const indexRoute = require('./routes')
const userRoute = require('./routes/user')
const cookieParser = require('cookie-parser')
const session = require('express-session')

app.use(cookieParser('cms_limingru'))
app.use(
  session({
    secret: 'cms_limingru',
    resave: true,
    saveUninitialized: true
  })
)
app.use(express.json())
app.use('/', indexRoute)
app.use('/user', userRoute)

app.listen(PORT, () => {
  console.log(`应用启动成功 http://localhost:${PORT}`)
})
